#include "SQLWindow.h"

#include "SQLName.h"
#include "SQLOver.h"
#include "../visitor/SQLASTVisitor.h"

SQLWindow::SQLWindow(SQLName_ptr name, SQLOver_ptr over)
{
  this->setName(name);
  this->setOver(over);
}

SQLName_ptr SQLWindow::getName()
{
  return name;
}

void SQLWindow::setName(SQLName_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLWindow));
  }
  this->name = x;
}

SQLOver_ptr SQLWindow::getOver()
{
  return over;
}

void SQLWindow::setOver(SQLOver_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLWindow));
  }
  this->over = x;
}

void SQLWindow::accept0(SQLASTVisitor_ptr v)
{
  if (v->visit(SharedObject(SQLWindow)))
  {
    acceptChild(v, name);
    acceptChild(v, SQLOver_ptr(over));
  }
  v->endVisit(SharedObject(SQLWindow));
}
